import axios from './request'


//所有的接口
//登录
function user_login( params = {} ){
    return axios.post('/api/user/login',params);
}
//注册
function user_register( params = {} ){
    return axios.post('/api/user/register',params);
}
//轮播图
function index_banner( params = {} ){
    return axios.get('/api/index/banner',{params});
}
//导航
function index_nav( params = {} ){
    return axios.get('/api/index/nav',{params});
}
//推荐列表
function index_goodlist( params = {} ){
    return axios.get('/api/index/goodlist',{params});
}
//一级分类
function category_list( params = {} ){
    return axios.get('/api/category/list',{params});
}
//二三级分类
function category_subcate( params = {} ){
    return axios.get('/api/category/subcate',{params});
}
//所有分类 按分类搜索
function good_list( params = {} ){
    return axios.get('/api/good/list',{params});
}
//所有商品 按关键字搜索
function good_search( params = {} ){
    return axios.get('/api/good/search',{params});
}
//商品 详情
function good_goodinfo( params = {} ){
    return axios.get('/api/good/goodinfo',{params});
}
//商品 收藏列表
function good_favlist( params = {} ){
    return axios.get('/api/good/favlist',{params});
}
//商品 收藏
function good_fav( params = {} ){
    return axios.post('/api/good/fav',params);
}
//商品 取消收藏
function good_unfav( params = {} ){
    return axios.post('/api/good/unfav',params);
}
//购物车 列表
function shopcart_list( params = {} ){
    return axios.get('/api/shopcart/list',{params});
}
//购物车 清空
function shopcart_clear( params = {} ){
    return axios.post('/api/shopcart/clear',params);
}
//购物车 数量加一
function shopcart_add( params = {} ){
    return axios.post('/api/shopcart/add',params);
}
//购物车 数量减一
function shopcart_sub( params = {} ){
    return axios.post('/api/shopcart/sub',params);
}


///抛出所有接口
export{
    user_login,
    user_register,
    index_banner,
    index_nav,
    index_goodlist,
    category_list,
    category_subcate,
    good_list,
    good_search,
    good_goodinfo,
    good_favlist,
    good_fav,
    good_unfav,
    shopcart_list,
    shopcart_clear,
    shopcart_add,
    shopcart_sub
}
